#ifndef LOGINWIDGET_H
#define LOGINWIDGET_H

#include "verifycodewidget.h"

#include <QWidget>
#include <QLineEdit>
#include <QLabel>
#include <QPushButton>

class LoginWidget : public QWidget
{
    Q_OBJECT
public:
    explicit LoginWidget(QWidget *parent = nullptr);

    void switchMode();

    void clickSubmitBtn();
    void clickPhoneModeBtn();
    void userLoginDone(bool ok, const QString& reason);
    void userRegisterDone(bool ok, const QString& reason);

private:
    bool isLoginMode = true;

    QLineEdit* usernameEdit = nullptr;
    QLineEdit* passwordEdit = nullptr;
    QLineEdit* verifyCodeEdit = nullptr;
    VerifyCodeWidget* verifyCodeWidget = nullptr;

    QLabel* titleLabel = nullptr;
    QPushButton* submitBtn = nullptr;
    QPushButton* phoneModeBtn = nullptr;
    QPushButton* switchModeBtn = nullptr;
};

#endif // LOGINWIDGET_H
